﻿using DatabaseLockCoreSample.Data.Core;
using Microsoft.EntityFrameworkCore;
using System;
using System.Collections.Generic;
using System.Text;

namespace DatabaseLockCoreSample.Data.Mapping
{
    public class GirlMap
        : IEntityTypeConfiguration<Girl>
    {
        public void Configure(Microsoft.EntityFrameworkCore.Metadata.Builders.EntityTypeBuilder<Girl> builder)
        {
            builder.ToTable("T_Girl");
            builder.HasKey(t => t.Id);
            builder.Property(t => t.Id)
                .HasColumnName("Id")
                .IsRequired(true);
            builder.Property(t => t.Name)
                .HasColumnName("Name")
                .HasMaxLength(30)
                .IsUnicode(true)
                .IsRequired(true);
            builder.Property(t => t.BF)
                .HasColumnName("BF")
                .HasMaxLength(30)
                .IsUnicode(true)
                .IsRequired(true);
            builder.Property(t => t.RowVersion)
                .HasColumnName("RowVersion")
                .IsRowVersion()
                .IsRequired(true);
        }
    }
}
